$(document).ready(function(){
	var server = "cdt"
	//拉起支付
	$.prepaid = function(amount){
			            var xhr = new XMLHttpRequest();
			            xhr.open("GET", "/"+server+"/chargeCreate?access_token="+$('.access_token').val()+"&channel=wx_pub&amount="+amount, true);
			            xhr.send();
			            xhr.onreadystatechange = function () {
			                if (xhr.readyState == 4 && xhr.status == 200) {
	//		                    alert(xhr.responseText);
			                    pingpp.createPayment(xhr.responseText, function(result, err) {
			                    	if(result == "success"){
			                    		
						    		}			                        
			                    });
			                }
			            }		
	}

	$('.charge10Btn').mousedown(function(){
		$(this).css('background','#000000').css('color','#545454');
	})

	$('.charge10Btn').mouseup(function(){
		$(this).css('background','#00C4C3').css('color','#FFFFFF');	
		$.prepaid(1000);
	})	

	$('.charge100Btn').mousedown(function(){
		$(this).css('background','#000000').css('color','#545454');
	})

	$('.charge100Btn').mouseup(function(){
		$(this).css('background','#00C4C3').css('color','#FFFFFF');
		$.prepaid(10000);
	})

})